using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Typing_GUI.CLASS;

namespace Typing_GUI
{
    public partial class frmStatistics : Form
    {
        public frmStatistics()
        {
            InitializeComponent();
        }
        private int m_id;

        public int Id
        {
            get { return m_id; }
            set { m_id = value; }
        }
        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void frmStatistics_Load(object sender, EventArgs e)
        {
            try
            {
                
                DataTable dt1 = CNguoiDung.LoadStatisticsUser(Id, 1);
                dgvTextTyping.DataSource = dt1;

                DataTable dt2 = CNguoiDung.LoadStatisticsUser(Id, 2);
                dgvAdventure.DataSource = dt2;
            }
            catch
            {
                MessageBox.Show("Error connecting database !!", " ERROR !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void btnBackToMenu_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}